<template>  
  <view class="container">  
    姓名：<input type="text" v-model="student.student_name" placeholder="姓名" />  
    班级：<input type="text" v-model="student.student_class" placeholder="班级" />  
    成绩：<input type="number" v-model.number="student.student_score" placeholder="分数" />  
    学号：<input type="number" v-model.number="student.student_number" placeholder="学号" />  
    <button @click="submitScore">提交</button>  
  </view>  
</template>  
  
<script>  
export default {  
  data() {  
    return {  
      student: {  
        student_name: '学生1',  
        student_class: '1班',  
        student_score: 100,  
        student_number: 24001
      }  
    };  
  },  
  methods: {  
    submitScore() {  
		
	  console.log(this.student)
      // 假设你有一个提交成绩的API  
      uni.request({  
        url: 'http://localhost:8088/api/demo/stu_add',  
        method: 'POST',  
        data: this.student,  
        success: (res) => {  
          uni.showToast({ title: '提交成功', icon: 'success' });  
          // 跳转到成绩列表页面  
          // uni.navigateBack();  
        }  
      });  
    }  
  }  
};  
</script>  
  
<style>  
.container {  
  padding: 20px;  
}  
</style>